const util = require('../../utils/util.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    inputShowed: false,
    inputVal: "",
    dataList:'',
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },
  showInput: function () {
    this.setData({
      inputShowed: true
    });
  },
  hideInput: function () {
    this.setData({
      inputVal: "",
      inputShowed: false
    });
  },
  clearInput: function () {
    this.setData({
      inputVal: ""
    });
  },
  inputTyping: function (e) {
    this.setData({
      inputVal: e.detail.value
    });
    this.submitVal(this.data.inputVal);
  },
  submitVal: function(keywords){
    wx.navigateTo({
      url: '../sdetail/sdetail?keywords='+keywords,
    })

  },
  search: function() {
    util.requestUrl({
      url: '/foodHeat/list',
      method: 'get',
      success:function(e){
        that.setData({
          foodName:e.data.data
        })
      }
    })
  }
})